home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / General / MM3Tp.sea Folder / Made by Marksman / Sources / u / My_Modal.p < prev    next >
Text File  |  1994-01-16  |  4KB  |  174 lines

  1.  
  2. unit UMy_Modal;
  3. {  My_Modal                                 Handle this dialog }
  4. {  Copyright © 1994 George R. Cossey }
  5.  
  6. {    File name:  My_Modal
  7.     Function:  Handle this modal dialog.
  8.  
  9.     This dialog is called when:
  10.  
  11.     History: 1/16/94 Original by George Cossey
  12.  
  13. }
  14.  
  15.  
  16. interface
  17.  
  18.     uses
  19.         Printing, Folders, Sound,mmCommonMM_Demo,CommonMM_Demo;
  20.  
  21. { ======================================================= }
  22. { ======================================================= }
  23.  
  24. { Init the modal dialog }
  25. procedure D_Init_My_Modal;
  26.  
  27. { Hook into the modal dialog filter routine }
  28. function D_Filter_My_Modal(theDialog:DialogPtr;var theEvent:EventRecord;var itemHit:integer):Boolean;
  29.  
  30. { Refresh the modal dialog }
  31. procedure D_Refresh_My_Modal(theDialog:DialogPtr);
  32.  
  33. { Setup the modal dialog }
  34. procedure D_Setup_My_Modal(theDialog:DialogPtr);
  35.  
  36. { Hit in the modal dialog }
  37. procedure D_Hit_My_Modal(theDialog:DialogPtr;var itemHit:integer;var ExitDialog:Boolean);
  38.  
  39. { Exit the modal dialog }
  40. procedure D_Exit_My_Modal(theDialog:DialogPtr);
  41.  
  42. { ======================================================= }
  43. { ======================================================= }
  44.  
  45. implementation
  46.  
  47. { ======================================================= }
  48. { ======================================================= }
  49.  
  50. { Routine: D_Init_My_Modal }
  51. { Purpose: This routine is called while when the program is first run }
  52. { This is used for onetime initialization }
  53.  
  54. procedure D_Init_My_Modal;
  55.  
  56.  
  57. begin
  58. end;
  59.  
  60. { ======================================================= }
  61.  
  62. { Routine: D_Filter_My_Modal }
  63. { Purpose: This routine is called while inside of the Modal Dialog filter }
  64.  
  65. function D_Filter_My_Modal(theDialog:DialogPtr;var theEvent:EventRecord;var itemHit:integer):Boolean;
  66. var
  67.     Filter_My_Modal:Boolean;
  68.  
  69.  
  70. begin
  71. Filter_My_Modal := false;                        { Let the modal routine handle it }
  72. D_Filter_My_Modal := Filter_My_Modal;
  73. end;
  74.  
  75. { ======================================================= }
  76.  
  77. { Routine: D_Refresh_My_Modal }
  78. { Purpose: Refresh the modal dialog }
  79.  
  80. procedure D_Refresh_My_Modal(theDialog:DialogPtr);
  81.  
  82.  
  83. begin
  84. end;
  85.  
  86. { ======================================================= }
  87.  
  88. { Routine: D_Setup_My_Modal }
  89. { Purpose: Setup the modal dialog }
  90.  
  91. procedure D_Setup_My_Modal(theDialog:DialogPtr);
  92.  
  93.  
  94. begin
  95. end;
  96.  
  97. { ======================================================= }
  98.  
  99. { Routine: D_Hit_My_Modal }
  100. { Purpose: Hit in the modal dialog }
  101.  
  102. procedure D_Hit_My_Modal(theDialog:DialogPtr;var itemHit:integer;var ExitDialog:Boolean);
  103. var
  104.         DType:integer;                            { Type of dialog item }
  105.         DItem:Handle;                            { Handle to the dialog item }
  106.         CItem:ControlHandle;                    { Control handle }
  107.         theSelection:integer;                    { tool selection }
  108.  
  109.  
  110. begin
  111. { This is the default selection, when RETURN is pressed. }
  112. if (itemHit = ResD_Cancel2) then            { Handle the Button, Cancel, being pressed }
  113.     begin
  114.     end;
  115.  
  116. if (itemHit = ResD_OK3) then            { Handle the Button, OK, being pressed }
  117.     begin
  118.     end;
  119.  
  120. if (itemHit = ResD_Checkboxes) then            { Handle the checkbox, Checkboxes, being pressed }
  121.     begin
  122.     end;
  123.  
  124. if (itemHit = ResD_for_selections) then            { Handle the radio, for selections, being pressed }
  125.     begin
  126.     end;
  127.  
  128. if (itemHit = ResD_Radio_buttons) then            { Handle the radio, Radio buttons, being pressed }
  129.     begin
  130.     end;
  131.  
  132. if (itemHit = ResD_PopUp) then            { Handle the Popup, PopUp, being pressed }
  133.     begin
  134.     GetDItem(theDialog,ResD_PopUp,DType,DItem,tempRect);{ Get item information }
  135.     CItem := ControlHandle(DItem);
  136.     theSelection := GetCtlValue(CItem);            { Get the Popup selection }
  137.     case (theSelection)    of                    { Select correct item }
  138.         -1:begin end;
  139.         1:                    { for Apple }
  140.             begin
  141.             end;
  142.         2:                    { for Orange }
  143.             begin
  144.             end;
  145.         3:                    { for Peach }
  146.             begin
  147.             end;
  148.         4:                    { for Pear }
  149.             begin
  150.             end;
  151.  
  152.         otherwise                                { allow other buttons, trap for debug }
  153.             begin
  154.             end;                                { end of otherwise }
  155.         end;                                        { end of switch }
  156.     end;
  157.  
  158. end;
  159.  
  160. { ======================================================= }
  161.  
  162. { Routine: D_Exit_My_Modal }
  163. { Purpose: Exit the modal dialog }
  164.  
  165. procedure D_Exit_My_Modal(theDialog:DialogPtr);
  166.  
  167.  
  168. begin
  169. end;
  170.  
  171. { ======================================================= }
  172. { ======================================================= }
  173. end.
  174.